﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace NASA.BeAMartian.Controls
{
    public class ImageButton : Button
    {
        #region ImageSourceNormal Property

        public static readonly DependencyProperty ImageSourceNormalProperty = 
            DependencyProperty.Register("ImageSourceNormal", typeof(ImageSource), typeof(ImageButton),
            new PropertyMetadata(new PropertyChangedCallback(ImageButton.ImageSourceNormalPropertyChanged)));

        private static void ImageSourceNormalPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ImageButton control = obj as ImageButton;
            if (control != null)
            {
                control.OnImageSourceNormalPropertyChanged();
            }
        }

        public ImageSource ImageSourceNormal
        {
            get { return (ImageSource)this.GetValue(ImageButton.ImageSourceNormalProperty); }
            set { base.SetValue(ImageButton.ImageSourceNormalProperty, value); this.OnImageSourceNormalPropertyChanged(); }
        }

        protected virtual void OnImageSourceNormalPropertyChanged()
        {
        }

        #endregion ImageSourceNormal Property

        #region ImageSourceMouseOver Property

        public static readonly DependencyProperty ImageSourceMouseOverProperty = 
            DependencyProperty.Register("ImageSourceMouseOver", typeof(ImageSource), typeof(ImageButton),
            new PropertyMetadata(new PropertyChangedCallback(ImageButton.ImageSourceMouseOverPropertyChanged)));

        private static void ImageSourceMouseOverPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ImageButton control = obj as ImageButton;
            if (control != null)
            {
                control.OnImageSourceMouseOverPropertyChanged();
            }
        }

        public ImageSource ImageSourceMouseOver
        {
            get { return (ImageSource)this.GetValue(ImageButton.ImageSourceMouseOverProperty); }
            set { base.SetValue(ImageButton.ImageSourceMouseOverProperty, value); this.OnImageSourceMouseOverPropertyChanged(); }
        }

        protected virtual void OnImageSourceMouseOverPropertyChanged()
        {
        }

        #endregion ImageSourceMouseOver Property

        #region ImageSourceMouseDown Property

        public static readonly DependencyProperty ImageSourceMouseDownProperty =
            DependencyProperty.Register("ImageSourceMouseDown", typeof(ImageSource), typeof(ImageButton),
            new PropertyMetadata(new PropertyChangedCallback(ImageButton.ImageSourceMouseDownPropertyChanged)));

        private static void ImageSourceMouseDownPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            ImageButton control = obj as ImageButton;
            if (control != null)
            {
                control.OnImageSourceMouseDownPropertyChanged();
            }
        }

        public ImageSource ImageSourceMouseDown
        {
            get { return (ImageSource)this.GetValue(ImageButton.ImageSourceMouseDownProperty); }
            set { base.SetValue(ImageButton.ImageSourceMouseDownProperty, value); this.OnImageSourceMouseDownPropertyChanged(); }
        }

        protected virtual void OnImageSourceMouseDownPropertyChanged()
        {
        }

        #endregion ImageSourceMouseDown Property
    }
}
